﻿using System;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace Pipo.AeExtensions {
   public static class AskUser {

        public static DialogResult SaveChanges(string prompt = "Are you sure to save your changes?",
                                string title = "Confirmation"){
            return XtraMessageBox.Show(prompt, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                   MessageBoxDefaultButton.Button2);
        }

        public static DialogResult ExitForm(string prompt = "Are you sure to exit this module?",
                                string title = "Confirmation") {
            return XtraMessageBox.Show(prompt,title,MessageBoxButtons.YesNo,MessageBoxIcon.Stop,
                               MessageBoxDefaultButton.Button2);
        }

        public static DialogResult CancelChanges(string prompt = "Are you sure to cancel your changes?",
                                string title = "Confirmation") {
        return XtraMessageBox.Show(prompt,title,MessageBoxButtons.YesNo,MessageBoxIcon.Hand,
                               MessageBoxDefaultButton.Button2);
        }

       public static void PopupValidationError(string message, string title = "Validation."){
            XtraMessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Stop);
       }

       public static void PopupConfirmationMessage(string message, string title = "Confirmation"){
           XtraMessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
       }

       public static void PopupSystemError(string thereWasAProblemOpeningTheRecord, string systemError = "System Error")
           {
           XtraMessageBox.Show(thereWasAProblemOpeningTheRecord,systemError,MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
           }
   }
        
    
}
